from django.db import models
from django.conf import settings
import datetime

class SavedSearch (models.Model):
	name = models.CharField( max_length=200 )
	url = models.CharField( max_length=200 )
	search_json = models.TextField()
	context = models.CharField( max_length=200, null=True, blank=True )
	shared = models.BooleanField( default=False )
	date_created = models.DateTimeField( default=datetime.datetime.now )
	
	class Meta:
		db_table = getattr( settings, 'SEEKER_SAVEDSEARCH_TABLE', 'seeker_savedsearch' )
		ordering = ('name',)
	
	def __unicode__( self ):
		return self.name
